{{--模板继承--}}
@extends('public.father')
@section('content')
    @if ($errors->any())
        {{--错误处理--}}
        <div class="alert alert-danger">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif
    <form method="post" action="{{route('changepassword')}}">
        {{--注意：执行到这页面会报错--}}
        {{--在这里是因为框架给from表单CSRF 保护--}}
        {{--需要在表单中(任意位置)添加@csrf--}}
        @csrf
        <div class="card">
            <div class="card-header">
                修改资料
            </div>
            <div class="card-body">

                <div class="form-group">
                    <label for="exampleInputEmail1">用户名</label>
                    <input type="text" class="form-control"
                           placeholder="请输入用户名" name="name" value="{{Auth::user()->name}}">
                </div>
                <div class="form-group">
                    <label for="exampleInputPassword1">旧密码</label>
                    <input type="password" class="form-control"  placeholder="请输入密码" name="oldpassword">
                </div>
                <div class="form-group">
                    <label for="exampleInputPassword1">新密码</label>
                    <input type="password" class="form-control"  placeholder="请输入密码" name="password">
                </div>

                <div class="form-group">
                    <label for="exampleInputPassword1">确认密码</label>
                    <input type="password" class="form-control"  placeholder="请确认密码" name="password_confirmation">
                </div>
            </div>
            <div class="card-footer text-muted">
                <button type="submit" class="btn btn-primary">立即修改</button>
            </div>
        </div>
    </form>
@endsection